package com.itheima.manager.service.imp;

import com.itheima.manager.mapper.ContactMapper;
import com.itheima.manager.pojo.Contact;
import com.itheima.manager.service.ISelectByIdService;
import com.itheima.manager.util.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

public class SelectByIdServiceImp implements ISelectByIdService {
    @Override
    public Contact selectAllById(Integer id) {
        SqlSession session = SqlSessionUtil.getSession();
        ContactMapper mapper = session.getMapper(ContactMapper.class);
        Contact contact = mapper.selectAllById(id);
        return contact;
    }
}
